#!/usr/bin/python
# -*- coding: utf8 -*-

import sys
import os
import gc

from rule import *
from grammar import *
from algorithm import *

class Sentence:
    def __init__(self):
        self.words = None
        self.types = None

    def parse_corpus(self, txt):
        cells = txt.split()
        
        self.words = []
        self.types = []
        for c in cells:
            w, t = c.strip().rsplit(u'/', 1)
            self.words.append(w)
            self.types.append(get_terminal_symbol(t).index)
